// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

const db = cloud.database()
exports.main = async (event, context) => {
  try {
    return await db.collection('todos').where({index:event.index}).remove({
    success(res){
      console.log("删除成功",res)
    },
    fail(res){
      console.log("删除失败",res)
    }
    })
  } catch(e) {
    console.error(e)
  }
}
